#ifndef		MaterialLibrary_h
#define		MaterialLibrary_h

#include	<string>
#include	<list>

class Config;

struct Color
{
	float r, g, b;
};

struct Material
{
	std::string name;// newmtl
	float shininess;// Ns
	float alpha;// d
	Color diffuse;// Kd
	Color ambient;// Ka
	Color specular;// Ks
	Color emission;// Ke
	std::string texture;// map_Kd
};

class MaterialLibrary
{
public:
	MaterialLibrary(const Config & config);
	~MaterialLibrary();
	const std::list< Material > & Materials() const;
	unsigned int MaterialIndex(const std::string & name) const;
	void Load(const std::string & file);
	void Cleanup();
private:
	void ParseLine(const std::string & line);
private:
	const Config * m_config;
	std::list< Material > m_material;
};

#endif	//	MaterialLibrary_h

